package com.tomehay.termprojectmanage_server.controller;


import com.tomehay.termprojectmanage_server.pojo.Model.Allocation;
import com.tomehay.termprojectmanage_server.pojo.VO.AllocationVO;
import com.tomehay.termprojectmanage_server.pojo.VO.ResultVO;
import com.tomehay.termprojectmanage_server.service.AllocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tomehay
 * @since 2023-06-20
 */
@RestController
@RequestMapping("api/allocation")
public class AllocationController {
    @Autowired
    AllocationService allocationService;

    @GetMapping("/AllocateTermProject")
    public ResultVO<Void> AllocateTermProject(int group_id,int term_project_id){
        return allocationService.AllocateTermProject(group_id,term_project_id);
    }

    @GetMapping("/Allocations")
    public ResultVO<List<AllocationVO>> getAllocations(int course_id){
        return allocationService.getAllocations(course_id);
    }

    @GetMapping("/GetOne")
    public ResultVO<Allocation> getOneAllocate(int id){
        return allocationService.getOneAllocate(id);
    }
}
